package com.example.demo.enums;

import lombok.Getter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2025-06-08
 * Time: 15:57
 */
@Getter
public enum BookStatus {
    DELETE(0,"无效"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    private int code;
    private String status;

    BookStatus(int i, String s) {
        this.code=i;
        this.status=s;
    }

    public static BookStatus getStatusByCode(int code){
        switch (code){
            case 0:return DELETE;
            case 1:return NORMAL;
            case 2:return FORBIDDEN;
            default:return null;
        }
    }
}
